const express = require('express');
const router = express.Router(); 
const path = require('path');
const middleSession = require('../../middleware/middleSession')
/* GET home page. */
// router.get('/', function(req, res, next) {
//   res.render('index', { title: 'Express' });
// }); 
router.get('/create',middleSession, function(req, res, next) {
  res.sendFile(path.resolve(__dirname+'/../../views/create.html'));
});
router.get('/list',middleSession, function(req, res, next) {
  res.sendFile(path.resolve(__dirname+'/../../views/list.html'));
});
router.get('/success',middleSession, function(req, res, next) {
  res.render('success',{type:req.query.type})
});
router.get('/reg', function(req, res, next) {
  res.render('auth/reg')
});
router.get('/login', function(req, res, next) {
  res.render('auth/login')
});

module.exports = router;
